package com.example.compreshensiveshop.dao;

import com.example.compreshensiveshop.po.OrdersPO;
import com.example.compreshensiveshop.vo.DailySalesVO;
import com.example.compreshensiveshop.vo.OrderNumberVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.ArrayList;
import java.util.List;

@Mapper
public interface OrdersDao {
    /**
     *  获取订单数量
     * @param customerId
     * @return
     */
    OrderNumberVO getOrderNumber(@Param("customerId") Long customerId);

    /**
     *  添加订单
     * @param ordersPO
     */
    void addOrder(@Param("ordersPO") OrdersPO ordersPO);

    /**
     *  获取订单列表
     * @param customerId
     * @param status
     * @param offset
     * @param pageSize
     * @return
     */
    List<OrdersPO> getCustomerOrder(@Param("customerId") Long customerId,@Param("status") Integer status
                                      ,@Param("offset") int offset,@Param("pageSize") int pageSize);

    /**
     *  获取订单详情
     * @param ordersId
     * @return
     */
    OrdersPO queryById(@Param("ordersId") Long ordersId);

    /**
     *  获取超时订单
     * @return
     */
    List<Long> queryTimeoutOrders();

    /**
     *  关闭订单
     * @param orderId
     */
    void closeOrder(@Param("orderId") Long orderId);

    /**
     *  获取订单数量
     * @param customerId
     * @param status
     * @return
     */
    int countCustomerOrder(@Param("customerId") Long customerId,@Param("status") Integer status);

    /**
     *  修改订单状态
     * @param orderId
     * @param status
     */
    void updateOrderStatus(@Param("orderId") Long orderId,@Param("status") Integer status);
}
